package com.sun.commonadapter;

import android.content.Context;
import android.view.View;
import android.widget.CheckBox;

import java.util.List;

public class MyAdapter4 extends CommonAdapter<Been>{


    public MyAdapter4(Context context, List<Been> datas, int layoutId) {
        super(context, datas, layoutId);
    }

    @Override
    public void convert(ViewHolder holder, final Been been) {
        holder.setText(R.id.id_title,been.getTitle()).setText(R.id.id_desc,been.getDesc())
                .setText(R.id.id_time,been.getTime()).setText(R.id.id_phone,been.getPhone());
        final CheckBox ck = holder.getView(R.id.id_cb);
        ck.setChecked(been.getIsChecked());
        ck.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                been.setIsChecked(ck.isChecked());
            }
        });
    }
}
